"use strict";
cc._RF.push(module, '4f8ddyRoT9LPqxsLiBub+KC', 'Home');
// scripts/home/Home.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var SceneNavigator_1 = require("../../eazax-ccc/core/SceneNavigator");
var BrowserUtil_1 = require("../../eazax-ccc/utils/BrowserUtil");
var CaseManager_1 = require("../common/CaseManager");
var Toast_1 = require("../common/components/Toast");
var Constants_1 = require("../common/constants/Constants");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, executionOrder = _a.executionOrder;
var Home = /** @class */ (function (_super) {
    __extends(Home, _super);
    function Home() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    Home.prototype.onLoad = function () {
        this.init();
    };
    Home.prototype.start = function () {
        this.detectCaseParam();
    };
    Home.prototype.init = function () {
        // 设置首页
        SceneNavigator_1.default.setHome(Constants_1.SceneName.Home);
    };
    /**
     * 检测 URL 参数跳转示例
     */
    Home.prototype.detectCaseParam = function () {
        // 获取链接中的示例参数
        var caseName = BrowserUtil_1.default.getUrlParam('case');
        if (caseName) {
            if (CaseManager_1.default.hasCase(caseName)) {
                // 跳转到指定示例
                CaseManager_1.default.goCase(caseName);
            }
            else {
                Toast_1.default.show('啊这，，，，，没找到这个示例', caseName);
            }
        }
    };
    Home = __decorate([
        ccclass,
        executionOrder(-100)
    ], Home);
    return Home;
}(cc.Component));
exports.default = Home;

cc._RF.pop();